package com.zxd.threads.thread_correspondence;

/**
 * ClassName:Test
 * Package:com.zxd.threads.thread_correspondence
 *
 * @Date:2023/9/26 18:51
 * @Author:zxde
 */
public class Test {
    public static void main(String[] args) {
        Shop shop = new Shop();
        new Thread(() -> {
            while (true){
                shop.createGood();
            }
        }, "消费者1").start();

        new Thread(() ->{
            while (true){
                shop.createGood();
            }
        },"消费者2").start();
        new Thread(() ->{
            while (true){
                shop.getGood();
            }
        },"生产者1").start();
        new Thread(() ->{
            while (true){
                shop.getGood();
            }
        },"生产者2").start();
        new Thread(() ->{
            while (true){
                shop.getGood();
            }
        },"生产者3").start();
    }
}
